package com.tuanzi.loan.business.service.product.product;

import java.time.LocalDate;
import java.util.List;

import com.tuanzi.loan.vo.view.product.LoanProductInfoView;
import org.springframework.data.domain.Page;

import com.tuanzi.loan.business.entity.product.product.LoanProductInfo;
import com.tuanzi.loan.core.service.BaseAuditService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.product.product.LoanProductInfoSearchRequest;
import com.tuanzi.loan.vo.response.product.product.LoanProductInfoSearchResponse;

/**
 * @author Ray 2017/09/21
 */
public interface LoanProductInfoService extends BaseAuditService<LoanProductInfo, Long> {

	LoanProductInfoView loadProductInfoView(Long productInfoId);

	LoanProductInfoView saveOrUpdateProductInfoView(LoanProductInfoView view);

	Page<LoanProductInfoSearchResponse> list(PageSearcher<LoanProductInfoSearchRequest> pageSearcher);

	void online(LoanProductInfo productInfo);

	void online(List<LoanProductInfo> productInfos);

	void offline(List<LoanProductInfo> productInfos);

	void offline(LoanProductInfo productInfo);

	List<LoanProductInfo> listAllProductInfoByCompanyId(Long companyId);

	void sortDelete(LoanProductInfo one);

	void cleanSpaceRedis();

	void cleanProductRedis(Long productId);

	Long sumDailyClickUvLimitationByOnline(LoanProductInfoSearchRequest searchRequest);

	Long sumDailyClickUvLimitation(LoanProductInfoSearchRequest searchRequest);

	Long sumDailyClickUvRemainingByOnline(LoanProductInfoSearchRequest searchRequest);

	Long countOnline(LoanProductInfoSearchRequest searchRequest);

	Long countAutoOnline(LoanProductInfoSearchRequest searchRequest);

	void cleanProductCache(LoanProductInfo productInfo);

	void saveYesterdayConsumeMoney(Long proid);

	double takeBeforeTodayBalanceCache(Long proid);

	double getBalance(Long proid,Integer clickUv);

	Integer getClickUv(Long proid,LocalDate date);

	Float getProductUvValue(Long proid);
}
